<template>
<div>
  <!-- 无订单状态 -->
      <div v-if="list.length==0">
        <div class="content_robbing_box_text">
          <div class="content_robbing_box_img"><img src="../../asset/images/no_order2x.png" alt=""></div>
          <div>暂时没有订单哦~</div>
          <div>点击“刷新列表”试试</div>
        </div>
      </div>
  <div class="content" v-for="item in list" :key="item.id" >
    <div class="content_text">
      <div class="img"><img :src=item.image alt=""></div>
      <div class="content_text_r">
        <div class="content_text_r1">
          <span>距离：{{item.range}} 米</span>
          <span style="color:#4694ff">{{item.state}}</span>
        </div>
        <div>{{item.address}}</div>
        <div>备注：{{item.remark}}</div>
      </div>
    </div>
    <div class="btn" @click="GoToEditOrder(item.orderNo)"><button>我已到达</button></div>
  </div>
  <div class="footer">已完成订单请到个人中心>历史订单中查看</div>
</div>
</template>
<script>
import { mapGetters } from "vuex";
import { getInBeeUserOrderList ,haveArrived} from "services/order";
export default {
  name: "going",
  data() {
    return {
      list: [],
      orderNo:''
    };
  },
  computed: {
    ...mapGetters(["userInfo"])
  },
  created() {
    this.getList();
  },
  methods: {
    GoToEditOrder(orderNo) {
      this.$router.push({name:'editorder',params:{ orderNo }});
    },
    getList() {
      const { userNo } = this.userInfo;
      getInBeeUserOrderList({ userNo }).then(response => {
        //console.log(response);
        const { object } = response;
        object.forEach((item, index) => {
          this.list.push(item);
        });
      });
    }
    
  }
};
</script>
<style lang="less" scoped>
.content {
  width: 100%;
  display: flex;
  flex-direction: column;
  //margin-top:30px;
  padding: 30px 30px;
  background: #fff;
  margin-top: 30px;
  padding-bottom: 100px;
  .content_text {
    display: flex;
    font-size: 30px;
    color: #333;
    .img {
      width: 128px;
      height: 128px;
      img{
        width:100%;
      }
    }
    .content_text_r {
      width: 80%;
      margin-left: 30px;
      display: flex;
      flex-direction: column;
      .content_text_r1 {
        display: flex;
        justify-content: space-between;
      }
    }
  }
  .btn {
    margin-top: 30px;
    button {
      width: 690px;
      height: 80px;
      border-radius: 50px;
      background: #f7a427;
      color: #fff;
      font-size: 32px;
      border: none;
      outline: none;
    }
  }
}
.footer {
  position: fixed;
  bottom: 30px;
  width: 100%;
  text-align: center;
  margin: 0 auto;
  font-size: 24px;
  color: #999;
}
</style>
